package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 初始地址树表（由edu_address解析生成）
 *
 * @author zhiyuan
 * @since 2024-01-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_address_tree_initial")
@Schema(name = "EduAddressTreeInitial", title = "初始地址树表（由edu_address解析生成）", description = "初始地址树表（由edu_address解析生成）实体类")
public class EduAddressTreeInitial extends Model<EduAddressTreeInitial> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "addressId", description = "地址id")
    @TableId(value = "address_id", type = IdType.ASSIGN_ID)
    private Long addressId;

    @Schema(name = "areaCode", description = "行政区划编码")
    @TableField(value = "area_code")
    private String areaCode;

    @Schema(name = "areaName", description = "组织名称")
    @TableField(value = "area_name")
    private String areaName;

    @Schema(name = "areaType", description = "行政区划类型 ")
    @TableField(value = "area_type")
    private String areaType;

    @Schema(name = "contact", description = "联系人")
    @TableField(value = "contact")
    private String contact;

    @Schema(name = "cellphone", description = "联系人手机")
    @TableField(value = "cellphone")
    private String cellphone;

    @Schema(name = "phone", description = "联系人电话")
    @TableField(value = "phone")
    private String phone;

    @Schema(name = "rate", description = "级别")
    @TableField(value = "rate")
    private Integer rate;

    @Schema(name = "orderNo", description = "排序号")
    @TableField(value = "order_no")
    private Integer orderNo;

    @Schema(name = "primarySchool", description = "小学默认学校组织id")
    @TableField(value = "primary_school")
    private String primarySchool;

    @Schema(name = "middleSchool", description = "中学默认学校组织id")
    @TableField(value = "middle_school")
    private String middleSchool;

    @Schema(name = "parentId", description = "上级地址/区域")
    @TableField(value = "parent_id")
    private Long parentId;

    @Schema(name = "searchTerm", description = "检索项，使用#分割")
    @TableField(value = "search_term")
    private String searchTerm;

    @Schema(name = "isLeafNode", description = "是否叶子节点")
    @TableField(value = "is_leaf_node")
    private Integer leafNode;

    @Schema(name = "fullAddress", description = "完整地址信息")
    @TableField(value = "full_address")
    private String fullAddress;

    @Schema(name = "majorPointer", description = "映射记录指针，对应映射记录主键address_id")
    @TableField(value = "major_pointer")
    private Long majorPointer;

    @Schema(name = "isLastNode", description = "是否最后非叶子节点-original数据检索节点")
    @TableField(value = "is_last_node")
    private Integer lastNode;

    @Schema(name = "eduAddressId", description = "edu_address主键")
    @TableField(value = "edu_address_id")
    private String eduAddressId;

    @Schema(name = "esStatus", description = "0:未存到original,1:已保存到original,2:保存失败")
    @TableField(value = "es_status")
    private Integer esStatus;

    @Schema(name = "esMsg", description = "original状态描述")
    @TableField(value = "es_msg")
    private String esMsg;

    @Schema(name = "esTime", description = "original保存时间")
    @TableField(value = "es_time")
    private Date esTime;

    @Schema(name = "createName", description = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", description = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Schema(name = "del", description = "0,未删除,1,已删除")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @TableField(value = "del_uk", updateStrategy = FieldStrategy.NOT_NULL)
    private Long delUk;

    @Schema(name = "isChangeNode", description = "是否发生变更")
    @TableField(value = "is_change_node")
    private Integer isChangeNode;

    @Schema(name = "leafNum", description = "叶子节点数")
    @TableField(value = "leaf_num")
    private Integer leafNum;

    @Override
    public Serializable pkVal() {
        return this.addressId;
    }
}
